<?php

namespace DesignNew\Command;

/**
 * 
 * 然后给出一个接口，（Bulb）中的每个命令都要实现这个接口，得到一组命令集：
 */
class TurnOn implements Command
{
    protected $bulb;

    public function __construct(Bulb $bulb)
    {
        $this->bulb = $bulb;
    }

    public function execute()
    {
        $this->bulb->turnOn();
    }

    public function undo()
    {
        $this->bulb->turnOff();
    }

    public function redo()
    {
        $this->execute();
    }
}